package wqh.service.impl;

import org.springframework.stereotype.Service;
import wqh.dao.SensorDao;
import wqh.domain.Sensor;
import wqh.service.SensorService;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by devts on 2016/9/26.
 */
@Service("sensorService")
public class SensorServiceImpl implements SensorService {

    @Resource
    private SensorDao sensorDao;

    public List<Sensor> findAllRecord() {
        return this.sensorDao.findAllRecord();
    }

    public String findNameByID(Integer id) {
        return this.sensorDao.findNameByID(id);
    }

    public Sensor findAllByID(Integer id) {
        return this.sensorDao.findAllByID(id);
    }

    public int insertRecord(Sensor sensor) {
        return this.sensorDao.insertRecord(sensor);
    }

    public int updateRecord(Sensor sensor) {
        return this.sensorDao.updateRecord(sensor);
    }

    public int deleteRecord(Integer id) {
        return this.sensorDao.deleteRecord(id);
    }

    public int insertRecordSample(String name, Integer type) {
        return this.sensorDao.insertRecordSample(name, type);
    }

    public int insertRecordOld(Sensor sensor) {
        return this.sensorDao.insertRecordOld(sensor);
    }

    public int updateRecordOld(Sensor sensor) {
        return this.sensorDao.updateRecordOld(sensor);
    }

    public int updateNameById(String name, Integer id) {
        return this.sensorDao.updateNameById(name,id);
    }
}
